// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';
/**
 * 电商管理
 */
// 电子管理
import StoreManager from '@/views/commerce/StoreManager';
// 商品管理
import Goods from '@/views/commerce/Goods';
import GoodsDetails from '@/views/commerce/GoodsDetails';

// 评价管理
import Evaluation from '@/views/commerce/Evaluation';
//客户管理
import CustomerManagement from '@/views/commerce/CustomerManagement';


/**
 * 订单管理
 */
// 交易订单
import Order from '@/views/order/Order';

/**
 * 支付管理
 */
// 支付配置
import Config from '@/views/pay/Config';


/**
 * 系统管理
 */
// 用户管理
import user from '@/views/system/user';
// 菜单管理
import Module from '@/views/system/Module';
// 角色管理
import Role from '@/views/system/Role';
// 权限管理
import Permission from '@/views/system/Permission';

/**
 * 数据可视化
 */
// 图表界面
import statistics from '@/views/charts/statistics';

// 启用路由
Vue.use(Router);

// 导出路由
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [{
            path: '/commerce/StoreManager',
            name: '代理管理',
            component: StoreManager,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/commerce/Goods',
            name: '商品管理',
            component: Goods,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/commerce/GoodsDetails',
            name: '商品详情',
            component: GoodsDetails,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/commerce/Evaluation',
            name: '评价信息',
            component: Evaluation,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/commerce/CustomerManagement',
            name: '客户管理',
            component: CustomerManagement,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/order/Order',
            name: '交易订单',
            component: Order,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/pay/Config',
            name: '支付配置',
            component: Config,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/User',
            name: '用户管理',
            component: user,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/Module',
            name: '菜单管理',
            component: Module,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/Role',
            name: '角色管理',
            component: Role,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/Permission',
            name: '权限管理',
            component: Permission,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/charts/statistics',
            name: '数据可视化',
            component: statistics,
            meta: {
                requireAuth: true
            }
        }]
    }]
})